﻿<%@ Page Language="C#" MasterPageFile="~/DigitalTV.Master" AutoEventWireup="true" CodeBehind="ManterCanal.aspx.cs" Inherits="UI.ManterCanal" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div id="Principal" style="width:400px">
    
    <div id="Cadastro" class="divDados" style="width:400px">
     <span>Cadastro Canais</span><br/>
    <span>&nbsp; </span>
    <table>
        <tr>
            <td>
                Numero:</td>
            <td>
                <asp:TextBox ID="txtNumero" runat="server" Width="60px" 
                    ontextchanged="txtNumero_TextChanged"></asp:TextBox>
                <asp:Button ID="btNovoCanal" runat="server" Text="Novo Canal" 
                    onclick="btNovoCanal_Click" />
                <asp:Label ID="lbStatus" runat="server" Visible="False"></asp:Label>
            </td>
        </tr>
        <tr>
            <td>
                Nome:</td>
            <td>
                <asp:TextBox ID="Nome" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
                Temática:</td>
            <td>
                <asp:DropDownList ID="cbTematica" runat="server">
                    <asp:ListItem Value="0">Indefinido</asp:ListItem>
                    <asp:ListItem Value="1">Esporte</asp:ListItem>
                    <asp:ListItem Value="2">Saúde</asp:ListItem>
                    <asp:ListItem Value="3">Filme</asp:ListItem>
                    <asp:ListItem Value="4">Adulto</asp:ListItem>
                    <asp:ListItem Value="5">Infantil</asp:ListItem>
                    <asp:ListItem Value="6">Diversos</asp:ListItem>
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td>
                Descrição:</td>
            <td>
                <asp:TextBox ID="Descrição" runat="server" Height="59px" Width="263px"></asp:TextBox>
            </td>
        </tr>
    </table>
        <span>
    <asp:Button ID="btGravaCanal" runat="server" Text="Gravar" 
            onclick="btGravaCanal_Click" />
    <asp:Button ID="btCancelar" runat="server" Text="Cancelar" 
            onclick="btNovoCanal_Click" />
        <asp:Panel ID="Panel1" runat="server" Height="106px">
            <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                AllowSorting="True" AutoGenerateColumns="False" CellPadding="4" 
                DataKeyNames="nr_ID" DataSourceID="ObjectDataSource1" ForeColor="#333333" 
                GridLines="None" PageSize="4">
                <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
                <Columns>
                    <asp:CommandField ShowSelectButton="True" />
                    <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" 
                        ReadOnly="True" SortExpression="ID" />
                    <asp:BoundField DataField="Nome" HeaderText="Nome" 
                        SortExpression="Nome" />
                    <asp:BoundField DataField="Tematica" HeaderText="Tematica" 
                        SortExpression="Tematica" />
                    <asp:BoundField DataField="Descrição" HeaderText="Descrição" 
                        SortExpression="Descrição" />
                    <asp:TemplateField HeaderText="Atualizar">
                       <ItemTemplate>
                           <asp:LinkButton ID="lbAtualizar" runat="server" onclick="lbAtualizar_Click"><span><span>Atualizar</span></span></asp:LinkButton>
                       </ItemTemplate>
                   </asp:TemplateField>
                   <asp:TemplateField HeaderText="Remover">
                       <ItemTemplate>
                           <asp:LinkButton ID="lbRemover" runat="server" onclick="lbRemover_Click"><span><span>Remover</span></span></asp:LinkButton>
                       </ItemTemplate>
                   </asp:TemplateField>
                </Columns>
                <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
                <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
                <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                <AlternatingRowStyle BackColor="White" />
            </asp:GridView>
            <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
                DeleteMethod="Delete" InsertMethod="Insert" 
                OldValuesParameterFormatString="original_{0}" SelectMethod="GetTodos" 
                TypeName="Dados_.DigitalTVDSTableAdapters.T_CanalTableAdapter" 
                UpdateMethod="Update">
                <DeleteParameters>
                    <asp:Parameter Name="Original_nr_ID" Type="Int32" />
                </DeleteParameters>
                <UpdateParameters>
                    <asp:Parameter Name="Nome" Type="String" />
                    <asp:Parameter Name="Tematica" Type="Int32" />
                    <asp:Parameter Name="Descrição" Type="String" />
                    <asp:Parameter Name="ID" Type="Int32" />
                </UpdateParameters>
                <InsertParameters>
                    <asp:Parameter Name="Nome" Type="String" />
                    <asp:Parameter Name="Tematica" Type="Int32" />
                    <asp:Parameter Name="Descrição" Type="String" />
                </InsertParameters>
            </asp:ObjectDataSource>
        </asp:Panel>
        </span>
    </div>
    </div>
</asp:Content>